<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {% block title %}
        <title>图书管理系统</title>
    {% endblock %}
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet">
    <script src="../../static/js/jquery-3.5.1.min.js"></script>
    <script src="../../static/js/bootstrap.bundle.min.js"></script>
    {% block head %}

    {% endblock %}
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">图书馆</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="{{url_for("front.index")}}">首页 <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{{ url_for("front.borrow_info") }}">借阅记录</a>
      </li>
        <li>
            <form class="form-inline my-2 my-lg-0">
                <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
                <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
            </form>
        </li>

    </ul>

      <ul class="navbar-nav mr-auto offset-6">
          {% if g.user %}
                 {% if g.user.is_staff %}
                     <li class="nav-item">
                        <a class="nav-link" href="{{ url_for("cms.cms_index") }}">后台系统</a>
                     </li>
                 {% endif %}
                 <li class="nav-item">
                   <a class="nav-link" href="#">{{g.user.username}}</a>
                 </li>
                <li>
                    <a class="nav-link" href="{{url_for("user.logout")}}">退出登录</a>
                </li>
              {% else %}
                 <li class="nav-item">
                     <a class="nav-link" href="{{url_for("user.login")}}">登录</a>
                </li>
                 <li class="nav-item">
                    <a class="nav-link" href="{{url_for("user.register")}}">注册</a>
                </li>
          {% endif %}


      </ul>


  </div>
</nav>

    {% block body %}

    {% endblock %}
</body>
</html>